package com.dartfar.workflow.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * 流程任务节点挂接表
 * @author 王琦
 *
 */

@Entity
@Table(name = "T_WorkflowTaskFunMount")
public class WorkflowTaskFunMount {

	//主键
	private int id;
	//流程部署ID
	private String deployId;
	//流程定义ID
	private String processDefinitionId;
	//业务实体名称
	private String modelName;
	//业务实体主键名称
	private String modelIdName;
	//任务节点ID
	private int taskNodeId;
	//任务节点名称
	private String taskNodeName;
	//可用按钮列表
	private String ableButtons;
	//编辑字段列表
	private String ableFileds;
	//流程挂接信息
	private WorkflowProcessFunMount workflowProcessFunMount;
	//任务节点事件
	private List<WorkflowEvents> workflowEvents;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getDeployId() {
		return deployId;
	}
	public void setDeployId(String deployId) {
		this.deployId = deployId;
	}
	public String getProcessDefinitionId() {
		return processDefinitionId;
	}
	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}
	public String getModelName() {
		return modelName;
	}
	public void setModelName(String modelName) {
		this.modelName = modelName;
	}
	public String getModelIdName() {
		return modelIdName;
	}
	public void setModelIdName(String modelIdName) {
		this.modelIdName = modelIdName;
	}
	public int getTaskNodeId() {
		return taskNodeId;
	}
	public void setTaskNodeId(int taskNodeId) {
		this.taskNodeId = taskNodeId;
	}
	public String getTaskNodeName() {
		return taskNodeName;
	}
	public void setTaskNodeName(String taskNodeName) {
		this.taskNodeName = taskNodeName;
	}
	public String getAbleButtons() {
		return ableButtons;
	}
	public void setAbleButtons(String ableButtons) {
		this.ableButtons = ableButtons;
	}
	public String getAbleFileds() {
		return ableFileds;
	}
	public void setAbleFileds(String ableFileds) {
		this.ableFileds = ableFileds;
	}
	
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	public WorkflowProcessFunMount getWorkflowProcessFunMount() {
		return workflowProcessFunMount;
	}
	public void setWorkflowProcessFunMount(
			WorkflowProcessFunMount workflowProcessFunMount) {
		this.workflowProcessFunMount = workflowProcessFunMount;
	}

	@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, mappedBy = "workflowTaskFunMount")
	@LazyCollection(LazyCollectionOption.TRUE)
	public List<WorkflowEvents> getWorkflowEvents() {
		return workflowEvents;
	}
	public void setWorkflowEvents(List<WorkflowEvents> workflowEvents) {
		this.workflowEvents = workflowEvents;
	}

	
}
